#include "updatethread.h"

UpdateThread::UpdateThread(World * world_, Space * space_) : QThread() {
    world = world_;
    space = space_;
    sim = false;
}

void UpdateThread::run() {
    while (true) {
        if (sim) {
            world -> update();
            space -> repaint();
        }
    }
}

void UpdateThread::setSimulate(bool sim_) {
    sim = sim_;
}
